{% extends 'base.html' %}
{% block js %}
    <script>
{#    $(function () {#}
{#        if('{{ parking_num }}'!= ''){#}
{#            $('#id_parking_num').attr("readonly","readonly");#}
{#        }#}
{##}
{#    })#}
    </script>
{% endblock %}
{% block content %}
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        车场管理
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 车场管理</a></li>
        <li class="active">{{ action|default:'新增' }}</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content">
        <div class="box box-primary">
          <div class="box-header with-border">
            <h3 class="box-title">{{ action|default:'新增' }}车场</h3>
            <div class="box-tools pull-right">
                <button class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
            </div><!-- /.box-tools -->
          </div><!-- /.box-header -->
          <div class="box-body">
              {% if parking_form.errors  %}
                  <div class="alert alert-danger">
                    <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                    <h4><i class="icon fa fa-ban"></i> 错误</h4>
                    {% for error in parking_form.errors.values %}
                      {{ error }}
                    {% endfor %}
                  </div>
              {% endif %}
               <form id="parkingform" method="POST" class="form-horizontal" >
                   {% csrf_token %}
                    <div class="form-group">
                        <label for="subtext" class="col-sm-5 control-label">车场编号</label>
                        <div class="col-sm-2 ">
                            {{ parking_form.parking_num }}
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="subtext" class="col-sm-5 control-label">车场名称</label>
                        <div class="col-sm-5">
                            {{ parking_form.name }}
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="subtext" class="col-sm-5 control-label">车场地址</label>
                        <div class="col-sm-5">
                            {{ parking_form.address }}
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="subtext" class="col-sm-5 control-label">出入口</label>
                        <div class="col-sm-2">
                            {{ parking_form.port_num }}
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="subtext" class="col-sm-5 control-label">PRC设备</label>
                        <div class="col-sm-2">
                            {{ parking_form.PRC_num }}
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-md-offset-5 col-md-9">
                            <button type="submit" id="published" class="btn btn-primary"><i class="fa fa-save"></i> 保存</button>
                            <button type="reset" class="btn btn-primary "><i class="fa fa-undo"></i> 重置 </button>
                        </div>
                    </div>
               </form>
          </div>
        </div>

    </section>
    <!-- /.content -->
  </div>


{% endblock %}